<?php
// +----------------------------------------------------------------------
// | KITEGO-Admin「开箱即用」「人人全栈」
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.kitego.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed KITEGO并不是自由软件，未经许可不能去掉KITEGO相关版权
// +----------------------------------------------------------------------
// | Author: KITEGO Team <bd@kitego.cn>
// +----------------------------------------------------------------------

namespace app\adminapi\controller\v1\setting;

use app\adminapi\services\setting\SystemDeptService;
use kitego\base\BaseController;
use think\App;
use think\response\Json;

class SystemDeptController extends BaseController
{
    private SystemDeptService $service;

    public function __construct(App $app, SystemDeptService $service)
    {
        parent::__construct($app);
        $this->service = $service;
    }

    /**
     * 部门列表
     */
    public function listSystemDept(): Json
    {
        return $this->service->listSystemDept(req_decode());
    }

    /**
     * 编辑部门
     */
    public function editSystemDept(): Json
    {
        return $this->service->editSystemDept(req_decode());
    }

    /**
     * 批量删除部门
     */
    public function batchDelSystemDept(): Json
    {
        return $this->service->batchDelSystemDept(req_decode());
    }
}